<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:include page="../include/header.jsp" />
<script type="text/javaScript">
<!--
	function writeFormPage() {
		$('#listForm').attr('action', '<c:url value="/repairSystem/repairSystemWriteForm.do"/>');
		$('#listForm').submit();
	}
	
	function updateFormPage(id) {
		$('#srs_repr_key').val(id);
		$('#listForm').attr('action', '<c:url value="/repairSystem/repairSystemWriteForm.do"/>');
		$('#listForm').submit();
	}
	function paging(pageNo){
		$('#pageIndex').val(pageNo);
		$('#listForm').attr('action', '<c:url value="/repairSystem/repairSystemList.do"/>');
		$('#listForm').submit();
	}
	
	$(document).ready(function(){
		$('.overShowTooltip').each(function(){
			$(this).hover(function(){
				$(this).children('span').show();
			}, function(){
				$(this).children('span').hide();
			});
		});
	});

-->
</script>
<!-- contents s -->
<div class="container" id="container">
	<span class="round lt">&nbsp;</span>
    <span class="round rt">&nbsp;</span>
    <span class="round lb">&nbsp;</span>
    <span class="round rb">&nbsp;</span>
    <div class="container_area">
    <form name="listForm" id="listForm" method="post" action="<c:url value='/repairSystem/repairSystemList.do'/>">
		<input type="hidden" name="pageIndex" id="pageIndex" value="${repairSystemVO.pageIndex }"/>
		<input type="hidden" name="srs_repr_key" id="srs_repr_key" />
		<input type="hidden" name="srs_area_key" id="srs_area_key" value="${repairSystemVO.srs_area_key }"/>
	</form>
        <h2 class="tit_h2">고장/조치 현황 목록</h2>
        <jsp:include page="../include/navi.jsp" />
        <div class="table_wrap">
        	<table summary="고장/조치 현황 목록" class="table_list">
            	<caption>고장/조치 현황 목록</caption>
                <colgroup>
                	<col width="10%" /> <!-- D : col width로 테이블 넓이 조절 -->
                    <col width="12%" />
                    <col width="23%" />
                    <col width="23%" />
                    <col width="23%" />
                    <col width="19%" />
                </colgroup>
                <thead>
                	<tr>
                    	<th scope="col">번호</th>
                        <th scope="col">품명</th>
                        <th scope="col">고장일자/내용</th>
                        <th scope="col">보고일자/내용</th>
                        <th scope="col">수리일자/내용</th>
                        <th scope="col">기타</th>
                    </tr>
                </thead>
                <tbody>
                <c:if test="${not empty resultList}">
	                <c:forEach var="result" items="${resultList}" varStatus="status">
	                <c:set var="srs_trbl_desc" value="${result.srs_trbl_desc}"/>
	                <c:set var="srs_rept_desc" value="${result.srs_rept_desc}"/>
	                <c:set var="srs_repr_desc" value="${result.srs_repr_desc}"/>
	                <c:if test="${fn:length(srs_trbl_desc) > 8}"><c:set var="srs_trbl_desc" value="${fn:substring(srs_trbl_desc,0,8)}..."/></c:if>
	                <c:if test="${fn:length(srs_rept_desc) > 8}"><c:set var="srs_rept_desc" value="${fn:substring(srs_rept_desc,0,8)}..."/></c:if>
	                <c:if test="${fn:length(srs_repr_desc) > 8}"><c:set var="srs_repr_desc" value="${fn:substring(srs_repr_desc,0,8)}..."/></c:if>
					<tr>
						<td>${(repairSystemVO.rowNum)-(status.count-1)}</td>
						<td><a href="<c:url value="/repairSystem/repairSystemWriteForm.do"/>" onclick="updateFormPage('${result.srs_repr_key}'); return false;"><c:out value="${result.srs_sys_name}"/></a>&nbsp;</td>
						<td class="overShowTooltip">${result.srs_trbl_date} / ${srs_trbl_desc}<span class="tooltipContent">${result.srs_trbl_date} / ${result.srs_trbl_desc}</span></td>
						<td class="overShowTooltip">${result.srs_rept_date} / ${srs_rept_desc}<span class="tooltipContent">${result.srs_rept_date} / ${result.srs_rept_desc}</span></td>
						<td class="overShowTooltip">${result.srs_repr_date} / ${srs_repr_desc}<span class="tooltipContent">${result.srs_repr_date} / ${result.srs_repr_desc}</span></td>
						<td>${result.srs_etc_info}</td>
					</tr>
					</c:forEach>
				</c:if>
				<c:if test="${empty resultList}">
					<tr><td colspan="6">데이터가 없습니다.</td></tr>
				</c:if>
                </tbody>
            </table>
        </div>
        <div class="paging">
			<ui:pagination paginationInfo="${repairSystemVO}" type="image" jsFunction="paging" />
		</div>
		<div class="btn_bbs">
			<a href="<c:url value="/repairSystem/repairSystemWriteForm.do"/>" onclick="writeFormPage(); return false;" class="btn_write">고장/조치 현황 등록</a>
			<c:if test="${loginSessionInfo.admin }">
				<a href="<c:url value="/repairSystem/repairServiceareaList.do"/>" class="btn_write">리스트</a>
			</c:if>
		</div>
    </div>
</div>
	<!-- contents e -->
<jsp:include page="../include/footer.jsp" />